<?php

use Monolog\Formatter\JsonFormatter;
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;

return [

    /*
    |--------------------------------------------------------------------------
    | Default Log Channel
    |--------------------------------------------------------------------------
    |
    | This option defines the default log channel that gets used when writing
    | messages to the logs. The name specified in this option should match
    | one of the channels defined in the "channels" configuration array.
    |
    */

//    'default' => env('LOG_CHANNEL', 'default'),
    'default' => 'default',

    /*
    |--------------------------------------------------------------------------
    | Deprecations Log Channel
    |--------------------------------------------------------------------------
    |
    | This option controls the log channel that should be used to log warnings
    | regarding deprecated PHP and library features. This allows you to get
    | your application ready for upcoming major versions of dependencies.
    |
    */

    'deprecations' => [
        'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
        'trace' => false,
    ],

    /*
    |--------------------------------------------------------------------------
    | Log Channels
    |--------------------------------------------------------------------------
    |
    | Here you may configure the log channels for your application. Out of
    | the box, Laravel uses the Monolog PHP logging library. This gives
    | you a variety of powerful log handlers / formatters to utilize.
    |
    | Available Drivers: "single", "daily", "slack", "syslog",
    |                    "errorlog", "monolog",
    |                    "custom", "stack"
    |
    */

    'channels' => [
        'default' => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/log/log.log'),
            'level'     => 'info',
            'days'      => 14,
            'formatter' => JsonFormatter::class,
        ],
        'error' => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/error/log.log'),
            'level'     => 'info',
            'days'      => 14,
            'formatter' => JsonFormatter::class,
        ],
        'single' => [
            'driver' => 'single',
            'path' => storage_path('logs/laravel.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'replace_placeholders' => true,
        ],

        'daily' => [
            'driver' => 'daily',
            'path' => storage_path('logs/laravel.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 14,
            'replace_placeholders' => true,
        ],
        'task' => [
            'driver' => 'single',
            'path' => storage_path('logs/task/task.log'),
            'level' => env('LOG_LEVEL', 'debug'),
        ],
        'sql' => [
            'driver' => 'daily',
            'path' => storage_path('logs/sql/sql.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'permission'=>0777
        ],
        'order_job' => [
            'driver' => 'daily',
            'path' => storage_path('logs/order_job/error.log'),
            'level' =>'error',
            'days' => 14,
        ],
        'api_request' => [
            'driver' => 'daily',
            'path' => storage_path('logs/api_request/info.log'),
            'level' =>'info',
            'days' => 14,
        ],
        'batch_request' => [
            'driver' => 'daily',
            'path' => storage_path('logs/batch_request/info.log'),
            'level' =>'info',
            'days' => 14,
        ],
        'place_request' => [
            'driver' => 'daily',
            'path' => storage_path('logs/place_request/error.log'),
            'level' =>'error',
            'days' => 14,
        ],
        'recharge_info' => [
            'driver' => 'daily',
            'path' => storage_path('logs/recharge_info/info.log'),
            'level' =>'info',
            'days' => 14,
        ],
        'notify_info' => [
            'driver' => 'daily',
            'path' => storage_path('logs/notify_info/info.log'),
            'level' =>'info',
            'days' => 14,
        ],
        'cycle' => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/api/cycle.log'),
            'level'     =>'info',
            'days'      => 14,
            'formatter' => JsonFormatter::class,
        ],
        'zuhe' => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/api/zuhe.log'),
            'level'     => 'info',
            'days'      => 14,
            'formatter' => JsonFormatter::class,
        ],
        'api-direct' => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/api/zhichong.log'),
            'level'     => 'info',
            'days'      => 14,
            'formatter' => JsonFormatter::class,
        ],
        'http-client' => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/http/client.log'),
            'level'     => 'info',
            'days'      => 14,
            'formatter' => JsonFormatter::class,
        ],
        'job' => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/job/job.log'),
            'level'     => 'info',
            'days'      => 14,
            'formatter' => JsonFormatter::class,
        ],
        'response'  => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/response/log.log'),
            'level'     => 'info',
            'days'      => 14,
            'formatter' => JsonFormatter::class,
        ],
        'fundAdd'  => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/fundAdd/log.log'),
            'level'     => 'info',
            'days'      => 14,
            'formatter' => JsonFormatter::class,
        ],
    ],
];
